﻿using Microsoft.AspNetCore.Identity;
using Shop.Application.UserAdmin.Dto;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;

namespace Shop.Application.UserAdmin
{
    public class DeleteUser
    {
        private UserManager<IdentityUser> _userManager;

        public DeleteUser(UserManager<IdentityUser> userManager)
        {
            _userManager = userManager;
        }

        public async Task<bool> Do(string id)
        {
            return (await _userManager.DeleteAsync(await _userManager.FindByIdAsync(id))).Succeeded;
        }
    }
}
